package com.example.edits;

import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class ProgressDialogActivity extends AppCompatActivity {

    Button btn1;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_progress_dlg);

        btn1 = findViewById(R.id.pdlg_btn1);

        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ProgressDialog pdlg = new ProgressDialog(ProgressDialogActivity.this);
                pdlg.setTitle("标题");
                pdlg.setMessage("loading...");
                pdlg.setCancelable(true);
                pdlg.show();
            }
        });

    }
}
